package com.tankgame.its381b;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.Display;

public class tankgameMidlet extends MIDlet implements CommandListener {

    private Command exitCommand; // The exit command
    private tankgame game;

    public tankgameMidlet() {
    }

    public void startApp() {
        Display.getDisplay(this).setCurrent(game = new tankgame(false));
        game.addCommand(exitCommand = new Command("Exit", Command.EXIT, 0));
        game.setCommandListener(this);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command c, Displayable s) {
        if (c == exitCommand) {
            destroyApp(false);
            notifyDestroyed();
        }
    }
}
